<template>
  <div>这是first。。。。</div>
  <table>
    <tr>
      <td>id</td>
      <td>name</td>
      <td>index</td>
      <td></td>
    </tr>
    <tab :str="str" @change="del"></tab>
  </table>
</template>
<script>
import tab from '../../components/tableCom.vue'
export default {
  created() {
    // console.log(this.$route)
  },
  components: {
    tab
  },
  data() {
    return {
      mg: '',
      str: [
        { id: 1, name: 'first', age: 12 },
        { id: 2, name: 'two', age: 13 },
        { id: 3, name: 'three', age: 14 }
      ]
    }
  },
  methods: {
    del(val) {
      this.str = this.str.filter((a) => {
        return val !== a.id
      })
    }
  }
}
</script>
<style scoped>
table {
  border-collapse: collapse;
}
td {
  border: 2px solid rgb(61, 186, 12);
}
td {
  width: 80px;
  height: 25px;
  text-align: center;
  line-height: 25px;
}
</style>
